$(document).ready(function(){
    //本程序源码制作 蚂蚁网络 www.antcome.com  QQ：44784009
    //切换
    $('.tab li').mousemove(function(){
        $(this).addClass("tab_on").siblings("li").removeClass("tab_on");
        $(".tab_c div").eq($('.tab li').index(this)).fadeIn("slow").siblings().hide();
    });

    /*切换 author QQ 44784009*/
    var currentPosition = 0;
    var slideWidth = 188;
    var slides = $('#slideshow a');
    var numberOfSlides = slides.length;
    var maxMum = numberOfSlides-1;

    function play(){
        if(currentPosition<maxMum){ 
            currentPosition = currentPosition+1;
            $('#slidesContainer').animate({left: -slideWidth*currentPosition},"slow");
            //alert(currentPosition);
        }
        else{ 
            currentPosition = 0;
            $('#slidesContainer').animate({left: 0},"slow");
            //alert(currentPosition);
        };        
    }
    
    function playleft(){
        if(currentPosition>0){
            currentPosition = currentPosition-1;
            $('#slidesContainer').animate({left: -slideWidth*currentPosition},"slow");
        };            
        //alert(currentPosition);
    }
    
    var mytime;
    function resetTime(){
        mytime=setInterval(play,3000);
    }
    resetTime();
    function clearTime(){       
        clearInterval(mytime);
    }
    
    $("#rightControl").bind('click',play).bind('mouseover',clearTime).bind('mouseout',resetTime);
    $("#leftControl").bind('click',playleft).bind('mouseover',clearTime).bind('mouseout',resetTime);
    
});
